#include <bits/stdc++.h>
#include < >
using namespace std;
int main(){
	
	
	int arr[5] = {59, 40, 29};
	int size = 3;
	
	if(size < 5){
		arr[size] = 40;
		size++;
	}
	else{
		cout <<  "数组已满，无法添加！" << endl;
	}
	
	
	size_t insert_index = 1; 
    int insert_value = 15;
    if(size < 5) {
        for(int i = size; i > insert_index; i--) {
            arr[i] = arr[i - 1];
        }
        arr[insert_index] = insert_value;
        size++;
    } else {
        cerr << "数组已满，无法插入！" << endl;
    } arr[2] = 25;
    size_t delete_index = 0;
    for (int i = delete_index; i < size - 1; i++) {
        arr[i] = arr[i + 1];
    }
    size--; 
    int target = 25;
    bool found = false;
    for (int i = 0; i < size; i++) {
        if (arr[i] == target) {
            cout << "找到元素 " << target << " 在索引 " << i << endl;
            found = true;
            break;
        }
    }
    if (!found) cout << "未找到元素！" << endl;
    cout << "最终数组：";
    for (int i = 0; i < size; i++) {
        cout << arr[i] << " ";
    }
	return 0;
}